<?php
include_once dirname(__FILE__)."/../database.php";
include_once dirname(__FILE__)."/../constants.php";
include_once dirname(__FILE__)."/../../config.inc.php";
include_once dirname(__FILE__)."/quadrant.php";
include_once dirname(__FILE__)."/star_system.php";

class Galaxy
{
    private static $_quadrants;
    
    public function quadrants()
    {
        if(!count($this->_quadrants))
        {
            Galaxy::$_quadrants[ALPHA_QUADRANT] = new Quadrant(ALPHA_QUADRANT);
            Galaxy::$_quadrants[BETA_QUADRANT] = new Quadrant(BETA_QUADRANT);
            Galaxy::$_quadrants[GAMMA_QUADRANT] = new Quadrant(GAMMA_QUADRANT);
            Galaxy::$_quadrants[DELTA_QUADRANT] = new Quadrant(DELTA_QUADRANT);
        }
        
        return Galaxy::$_quadrants;
    }
    
    public function addQuadrantStarSystem()
    {
        $q = rand(0, 3);
        Galaxy::$_quadrants[$q].addStarSystem();
    }
    
    public function addQuadrantStarSystem($q)
    {        
        Galaxy::$_quadrants[$q].addStarSystem();
    }
}
?>
